<?php


// 处理字符串防止特殊符号引起的错误，
$process_include    = array('title', 'url');
string_pre_process($record, $process_include);


if($record['img'] != '') {
    $this_link_url = $G_web_upload . $record['img'];
} else {
    $this_link_url = $url_global['common'] . '/images/nopic.jpg';
}


$chk_display    = $record['display'] == 1 ? 'checked' : '';
$chk_top        = $record['top'] == 1 ? 'checked' : '';
if ($record['orders'] >= $G_big_integer || $record['orders'] <= 0) {
    $record['orders'] = '';
}

// 取得返回字符串
$back_url   = strcode(getcookie('back_url'), 'DECODE');
if($back_url == '') $back_url   = $mod_url['li'];



if($action == 'modify') {
    $txt_form_title = "修改友情链接";
} else {
    $txt_form_title = "新增友情链接";
}

require($abs_admin_cppath . '/header.php');
?>
<SCRIPT LANGUAGE="JavaScript" SRC="<?php echo $url_global['common']; ?>/js/Validator.js"></SCRIPT>


	<div class="datacontainer2" style="width:600px;">
<div class="header">
	&nbsp;&nbsp;<span class="font_form_head"><?php echo $txt_form_title; ?></span>
</div>
<form action="<?php echo $mod_url['save']; ?>" method="post" name="user_data" enctype="multipart/form-data" onsubmit="return Validator.Validate(this,3);">
<table BORDER="0" cellpadding="0" cellspacing="0" width="100%" class="list_table">

<TR>
	<TD width="120" align="right" class="caption">友情链接标题：</TD>
	<TD class="FormCell">
		<input type="text" name="link[title]" value="<?php echo $record['title']; ?>" class="text" size="40"
		dataType="Require" msg="“友情链接标题”必须填写">
		<span class="mustfill">*</span>
	</TD>
</TR>
<TR>
	<TD width="120" align="right" class="caption">点击链接到：</TD>
	<TD class="FormCell">
		<input type="text" name="link[url]" value="<?php echo $record['url']; ?>" class="text" size="40"> 
		&nbsp;需加http://前缀</TD>
</TR>

<TR>
	<TD width="120" align="right" class="caption">是否显示：</TD>
	<TD class="FormCell"><INPUT TYPE="checkbox" NAME="link[display]" id="display" value="1" <?php echo $chk_display; ?>> <label for="display">选择表示显示</label>
	</TD>
</TR>
<TR>
	<TD width="120" align="right" class="caption">排列属性：</TD>
	<TD class="FormCell">
    排序：
    <input type="text" name="link[orders]" size="3" value="<?php echo $record['orders']; ?>" 
				onkeydown="return non_num_filter();" 
				class="text"
				style="text-align:right;padding-right:2px;">

	</TD>
</TR>
<TR>
	<TD class="FormCell" colspan="2" align="center">
		<input type="submit" value=" 保存 " class="btn">
		<input type="reset" value=" 重置 " class="btn">
		<input type="button" value=" 返回 " class="btn" onclick="location.href='<?php echo $back_url; ?>'">
		<input type="hidden" name="link[id]" value="<?php echo $id; ?>">
		<input type="hidden" name="save" value="<?php echo $save_flag; ?>">
	</TD>
</TR>

</TABLE>
</form>
	</div>
<?php
require($abs_admin_cppath . '/footer.php');
?>